package com.example.repository;

import com.example.models.Item;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by Lin on 2016/7/14.
 */
@Repository //用于标注数据访问组件，即DAO组件.
public interface ItemRepository extends JpaRepository<Item,Integer> {
    @Query("SELECT i FROM Item i WHERE i.checked=true")
    List<Item> findChecked();
}
